import java.util.Arrays;
import java.util.List;

/**
 * 批次名称教育级别判断测试类
 * 用于验证 determineEducationLevel 方法的准确性
 */
public class BatchNameEducationLevelTest {

    /**
     * 根据批次名称确定教育级别（复制的方法用于测试）
     */
    private static String determineEducationLevel(String batchName) {
        if (batchName == null || batchName.isEmpty()) {
            return "本科"; // 默认为本科
        }

        // 转换为小写进行匹配，提高匹配准确性
        String lowerBatchName = batchName.toLowerCase();

        // 优先判断专科批次（更具体的匹配）
        if (lowerBatchName.contains("专科") || 
            lowerBatchName.contains("高职") ||
            lowerBatchName.contains("专科提前批") ||
            lowerBatchName.contains("艺术类专科") ||
            lowerBatchName.contains("体育类专科") ||
            lowerBatchName.contains("体育专科") ||
            lowerBatchName.contains("艺术专科") ||
            lowerBatchName.contains("专科批")) {
            return "专科";
        }

        // 判断本科批次
        if (lowerBatchName.contains("本科") ||
            lowerBatchName.contains("一批") ||
            lowerBatchName.contains("二批") ||
            lowerBatchName.contains("三批") ||
            lowerBatchName.contains("第一批") ||
            lowerBatchName.contains("第二批") ||
            lowerBatchName.contains("国家专项") ||
            lowerBatchName.contains("高校专项") ||
            lowerBatchName.contains("地方专项") ||
            lowerBatchName.contains("区域专项") ||
            lowerBatchName.contains("特殊类型") ||
            lowerBatchName.contains("艺术本科") ||
            lowerBatchName.contains("体育本科") ||
            lowerBatchName.contains("艺术类本科") ||
            lowerBatchName.contains("体育类本科") ||
            lowerBatchName.contains("本科提前") ||
            lowerBatchName.contains("提前批") ||
            lowerBatchName.contains("零批次") ||
            lowerBatchName.contains("零志愿") ||
            lowerBatchName.contains("平行录取") ||
            lowerBatchName.contains("普通类") ||
            lowerBatchName.contains("一段") ||
            lowerBatchName.contains("二段") ||
            lowerBatchName.contains("三段") ||
            lowerBatchName.contains("预科") ||
            lowerBatchName.contains("免费定向") ||
            lowerBatchName.contains("少数民族") ||
            lowerBatchName.contains("一类模式") ||
            lowerBatchName.contains("分类招生")) {
            return "本科";
        }

        // 对于无法明确判断的批次，默认返回本科
        System.out.println("无法明确判断批次教育级别，批次名称: " + batchName + "，默认返回本科");
        return "本科";
    }

    public static void main(String[] args) {
        // 测试用的批次名称列表
        List<String> batchNames = Arrays.asList(
            "本科批", "专科批", "本科提前批", "国家专项计划本科批", "高校专项计划本科批",
            "体育类本科批", "艺术类本科批", "高校专项计划批次", "地方专项计划本科批",
            "艺术类第二批B段", "专科提前批", "艺术类专科批", "本科二批", "本科一批",
            "体育类专科批", "第一批", "本科第一批提前批", "国家专项计划", "第二批B段",
            "本科第二批提前批", "艺术本科二批", "高校专项计划", "艺术类（本科二批B段）",
            "本科提前一批", "特殊类型招生批", "国家专项计划本科一批", "本科三批",
            "艺术本科A段", "本科B段", "艺术本科B段", "本科批B段", "平行录取一段",
            "平行录取二段", "体育本科提前批", "第二批第二段", "普通类提前批",
            "艺术类本科提前批", "体育专科提前批", "艺术类第二批", "普通类平行录取",
            "第二批第一段", "艺术类第一批", "艺术本科提前批", "提前批", "平行录取三段",
            "艺术本科批B段", "本科批A段", "本科A段", "艺术类本科B段", "区域专项计划本科批",
            "一类模式本科", "本科第一批", "本科批平行组", "体育类本科提前批",
            "本科提前批（第2小批）", "本科提前批艺术类第1小批", "本科提前批B段",
            "本科提前批A段", "本科提前批艺术类A段", "艺术本科提前批B段", "本科提前批C段",
            "艺术类本科提前批B段", "艺术类专科提前批", "体育类专科提前批", "体育本科批",
            "艺术本科批A段", "艺术类本科批A段", "分类招生批", "普通类一段", "普通类二段",
            "地方专项计划批", "国家及地方专项、南疆单列、对口援疆计划本科一批次",
            "国家及地方专项、南疆单列、对口援疆计划本科二批次", "本科第一阶段",
            "少数民族预科班", "本科批一段", "本科一批A段", "本科艺术甲批平行段",
            "艺术类本科批B段", "零批次", "零志愿批次", "提前批第一批本科",
            "提前批第二批本科", "艺术本科批C段", "本科二批及预科", "本科一批预科",
            "提前批B段", "提前批A段", "提前本科批", "本科二批A段", "体育类本科第二批",
            "本科一批B段", "本科二批B段", "本科免费定向批", "本科提前批C",
            "地方农村专项计划本科批", "本科一段", "本科二段", "本科专项计划批",
            "本科提前批艺术类", "本科A批", "本科第二批", "本科提前批艺术本科第二批",
            "艺本一批", "本科二批C段", "本科一批A1段", "提前一批本科", "提前二批本科",
            "专科提前批B段", "专科批A段", "本科三批A段", "艺术类本科A段"
        );

        System.out.println("批次名称教育级别判断测试结果：");
        System.out.println("========================================");
        
        int totalCount = 0;
        int benkeBatchCount = 0;
        int zhuankeBatchCount = 0;
        
        for (String batchName : batchNames) {
            String educationLevel = determineEducationLevel(batchName);
            System.out.printf("%-40s -> %s\n", batchName, educationLevel);
            
            totalCount++;
            if ("本科".equals(educationLevel)) {
                benkeBatchCount++;
            } else {
                zhuankeBatchCount++;
            }
        }
        
        System.out.println("========================================");
        System.out.printf("总计: %d 个批次\n", totalCount);
        System.out.printf("本科批次: %d 个\n", benkeBatchCount);
        System.out.printf("专科批次: %d 个\n", zhuankeBatchCount);
        System.out.printf("本科比例: %.1f%%\n", (double) benkeBatchCount / totalCount * 100);
        System.out.printf("专科比例: %.1f%%\n", (double) zhuankeBatchCount / totalCount * 100);
    }
}
